package cn.iocoder.yudao.module.aiposter.service.poster.bo;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

import java.util.Objects;

public enum ImgWidgetTypeEnum {
    IMG("w-image"),
    QR_CODE("w-qrcode"),
    TEXT("w-text"),
    SVG("w-svg"),
    GROUP("w-group"),
    PAGE("page");

    private final String name;
    ImgWidgetTypeEnum(String name) {
        this.name = name;
    }

    @JsonValue
    public String getName() {
        return name;
    }

    @JsonCreator
    public static ImgWidgetTypeEnum fromValue(String name) {
        for (ImgWidgetTypeEnum anEnum : ImgWidgetTypeEnum.values()) {
            if (Objects.equals(anEnum.getName(), name)) {
                return anEnum;
            }
        }
        return null;
    }
}
